/**
 * Created with IntelliJ IDEA.
 * Description:一个类之间的调用和引用
 * User: 石仲夏
 */
public class Data {
    public int year;
    public int month;
    public int day;
    public void setData(int year,int month,int day){
        this.year =year;
        this.month =month;
        this.day =day;
    }
    public void printData(){
       // this.setData(2025,7,7);
        System.out.println(this.year+"年"+this.month+"月"+this.day+"日");
    }
    public Data(){
        this(2020,7,7);
        System.out.println("这是不带参数的构造方法");
    }
    public Data(int year,int month,int day){
        this.year =year;
        this.month =month;
        this.day =day;
        System.out.println("这是带参数的构造方法");
    }

    public static void main(String[] args) {

    }
    public static void main2(String[] args) {
//        Data data =new Data();
//        data.printData();
//        Data data1 =new Data(2025,7,7);
//        data1.printData();
    }
    public static void main1(String[] args) {
        Data data1 = new Data();
        Data data2 = new Data();
        Data data3 = new Data();
        data1.setData(2025,7,7);
        data2.setData(2024,7,7);
        data3.setData(2023,7,7);
        data1.printData();
        data2.printData();
        data3.printData();
    }
}
